// 防抖
export const debounce = (fn: Function,
  interval: number = 500): Function => {
  let timer = 0
  return function (...args: any[]) {
    if (timer) {
      clearTimeout(timer)
    }
    timer = window.setTimeout(() => {
      fn(...args)
    }, interval)
  }
}